{include file='public/header' /}
<div class="layuimini-container">
    <form id="modelUserForm" lay-filter="modelUserForm" class="layui-form model-form">
        <input name="id" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">订单编号</label>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">{$row.order_sn}</div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">订单金额</label>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">{$row.amount}</div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">商品信息</label>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">{$row.Goods.title}</div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">用户昵称</label>
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux">{$row.User.nick_name}</div>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">订单状态:</label>
            <div class="layui-form-mid layui-word-aux">
                {if condition="$row->status eq 0"}
                待领取
                {elseif condition="$row->status eq 1" /}
                已领取
                {/if}
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">确认已领取:</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" disabled value="0" title="待领取"  >
                <input type="radio" name="status" value="1" title="已领取 "checked >
            </div>

        </div>
        <div class="layui-form-item text-right">
            <input type="hidden" name="id" value="{$row.id}">
            <button class="layui-btn layui-btn-primary" type="button" onclick="close_window()" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>保存</button>
        </div>
    </form>
</div>
{include file='public/footer' /}
<script>
    layui.use(['layer', 'form', 'table', 'util', 'admin'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;


        var url = '{:__url("mall.integral_order/edit")}';

        // 表单提交事件
        form.on('submit(modelSubmitUser)', function (data) {
            layer.load(2);
          console.log(data);
            $.post(url, data.field, function (res) {

                layer.closeAll('loading');
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1,time: 1000},function(index){
                        window.parent.location.reload();
                    });
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            }, 'json');
            return false;
        });
    });
    function close_window(){
        window.parent.location.reload();
    }
</script>